package com.aids_malaria.ui.report;

import android.view.View;

import com.aids_malaria.R;
import com.aids_malaria.app.Constant;
import com.aids_malaria.base.BaseFragment;
import com.aids_malaria.util.AuthUtil;
import com.aids_malaria.util.ToastUtil;

import butterknife.OnClick;

public class ReportFragment extends BaseFragment {

    private static ReportFragment instance;

    public static ReportFragment getInstance() {
        if(null == instance){
            instance = new ReportFragment();
        }
        return instance;
    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_report;
    }

    @OnClick({R.id.tv_count_report1,R.id.tv_count_report2})
    public void onClick(View view){
        switch (view.getId()){
            case R.id.tv_count_report1:
                if (!AuthUtil.isHaveQueryAuthByCode(Constant.REPORT_PERSON_DATA)){
                    ToastUtil.showNoPermission();
                    return;
                }
                startActivity(MemberDataActivity.class);
                break;
            case R.id.tv_count_report2:
                if (!AuthUtil.isHaveQueryAuthByCode(Constant.REPORT_MOSQUITO_BORNE_DATA)){
                    ToastUtil.showNoPermission();
                    return;
                }
                startActivity(MosquitoBorneActivity.class);
                break;
        }
    }

}
